#!/usr/bin/env python

import os
import sys

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from runtest_dalton import Filter, TestRun

test = TestRun(__file__, sys.argv)

f = Filter()

f.add(string = 'Final HF energy',
      rel_tolerance = 1.0e-8)

f.add(from_string = 'CCS        Excitation energies',
      num_lines = 32,
      abs_tolerance = 1.0e-6)

f.add(from_string = 'CCS        Length   Gauge Oscillator Strength',
      num_lines = 32,
      abs_tolerance = 1.0e-6)

f.add(from_string = 'CC Oscillator strength sum rules',
      num_lines = 48,
      abs_tolerance = 1.0e-5)

test.run(['cc_rsp_sumrules.dal'], ['helium.mol'], f={'out': f},
         accepted_errors=['not implemented for parallel calculations.'])

sys.exit(test.return_code)
